﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using CommunitySystem.PublicOfficialSelectionService;

namespace CommunitySystem
{
    public partial class ZhiWeiShiJianAnPaiWindow : ChildWindow
    {
        private PublicOfficialSelectionServiceClient Client1 = new PublicOfficialSelectionServiceClient();
        public ZhiWeiShiJianAnPaiWindow(int ID)
        {
            InitializeComponent();
            Client1.GetOneAnPaiSuoDingCompleted -= new EventHandler<GetOneAnPaiSuoDingCompletedEventArgs>(Client1_GetOneAnPaiSuoDingCompleted);
            Client1.GetOneAnPaiSuoDingCompleted += new EventHandler<GetOneAnPaiSuoDingCompletedEventArgs>(Client1_GetOneAnPaiSuoDingCompleted);
            Client1.GetOneAnPaiSuoDingAsync(ID);
        }

        void Client1_GetOneAnPaiSuoDingCompleted(object sender, GetOneAnPaiSuoDingCompletedEventArgs e)
        {
            DGRole.ItemsSource = e.Result;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}
